﻿using UnityEngine;
using UnityEngine.EventSystems;

namespace HKTools
{
    /// <summary>
    /// 滑动条
    /// </summary>
    public class HK_VideoSlider : MonoBehaviour, IPointerDownHandler, IPointerUpHandler, IEndDragHandler, IBeginDragHandler
    {
        HK_VideoCtrl videoCtrl;

        void Awake()
        {
            videoCtrl = transform.parent.GetComponent<HK_VideoCtrl>();
        }

        public void OnBeginDrag(PointerEventData eventData)
        {
            videoCtrl.OnValueSliderBeginDrag();
        }

        public void OnEndDrag(PointerEventData eventData)
        {
            videoCtrl.OnValueSliderEndDrag();
        }

        public void OnPointerDown(PointerEventData eventData)
        {
            videoCtrl.OnValueSliderPointerDown();
        }

        public void OnPointerUp(PointerEventData eventData)
        {
            videoCtrl.OnValueSliderPointerUp();
        }
    }
}